﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="company">
    <title></title>
    <script src="../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../plugins/jquery.com.js" type="text/javascript"></script>
    <script src="../../Scripts/szjt_org_toolkits.js" type="text/javascript"></script>
    <link href="../../themes/gray/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../themes/icon.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        window.onload = function () {
            var data = $.org.GetData("1", "11111111-1111-1111-1111-111111111111", "11111111-1111-1111-1111-111111111112", "CompanyList", null);
            $_company = $('#_company');
            $_company.datagrid({
                title: '',
                nowrap: false,
                striped: true,
                collapsible: false,
                singleSelect: true,
                remoteSort: false,
                idField: 'Guid',
                onLoadSuccess: function () {
                },
                columns: [[
                    { title: 'Guid', field: 'Guid', hidden: true }
				], [{ field: 'Name', title: '单位名称', width: 150, align: 'center' },
					{ field: 'OUType', title: '单位类型', width: 150, align: 'center' },
                    { field: 'MasterType', title: '主类型', width: 150, align: 'center' },
                    { field: 'SubType', title: '子类型', width: 150, align: 'center'}]],
                pagination: false,
                rownumbers: true,
                toolbar: [{
                    id: 'btnAdd',
                    text: '添加',
                    iconCls: 'icon-add',
                    handler: function () {
                        //toolkits.Window.open("_show2", { iconCls: "icon-add", title: "添加单位", width: 550, height: 210, collapsed: false }, "company.edit.html");
                    }
                }]
            });

            //var _al = service.EasyGetData("companylist", false);
            var _$al = com._cGetXmlObj(data);
            $list = _$al.find("OUDataInfo");
            $json = { total: $list.length, rows: [] };
            $list.each(function (i, n) {
                $json.rows.push({ Guid: $(n).attr("GUID"), Name: $(n).attr("NAME"), OUType: $(n).attr("OUType"), MasterType: $(n).parent().attr("MasterType"), SubType: $(n).parent().attr("SubType") });
            });
            $_company.datagrid("loadData", $json);

            $('#_show').window({
                width: 600,
                height: 260,
                title: '',
                draggable: false,
                modal: true,
                closed: true
            });
        }
    </script>
</head>
<body style="padding: 1px;">
    <div>
        <table id="_company" class="easyui-datagrid"> 
        </table>
    </div>
</body>
</html>
